/**
 * @author:albert
 */

package com.bkbw.live.battle.bean;

import org.apache.mina.core.session.IoSession;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import com.bkbw.live.battle.business.UnitObject;
import com.bkbw.live.common.dataproto.ClientToBattleServerPb.Vector3d;

public class UserAgent {
	Logger logger = LoggerFactory.getLogger("mylog");
	private IoSession session;
	private int charId;
	private String username;	
	protected UnitObject unit;
	private int uidSeed;
	
	
	
	public int getUidSeed() {
		return uidSeed;
	}
	public void setUidSeed(int uidSeed) {
		this.uidSeed = uidSeed;
	}
	
	public long getNewUid() {
		long uid = charId;
		uid = uid << 32;
		uid += uidSeed;
		++uidSeed;
		logger.debug("charid "+charId+ " newuid "+ uid);
		return uid;
	}
	
	public UnitObject getUnit() {
		return unit;
	}
	public void setUnit(UnitObject unit) {
		this.unit = unit;
	}
	public UserAgent(IoSession session, int charId, String username) {
		super();
		this.session = session;
		this.charId = charId;
		this.username = username;
	}
	public IoSession getSession() {
		return session;
	}
	public void setSession(IoSession session) {
		this.session = session;
	}
	public int getCharId() {
		return charId;
	}
	public void setCharId(int charId) {
		this.charId = charId;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	
}
